package com.ruoyi.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.platform.annotation.Excel;
import com.ruoyi.platform.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * 智联空间文件夹对象 tp_space_directory
 *
 * @author ruoyi
 * @date 2022-12-19
 */
@ApiModel(value = "智联空间文件夹对象 tp_space_directory", description = "tp_space_directory业务表")
@TableName("tp_space_directory")
@Data
public class SpaceDirectory extends BaseEntity<SpaceDirectory> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 文件夹名称
     */
    @Excel(name = "文件夹名称")
    @ApiModelProperty(value = "文件夹名称")
    private String name;

    /**
     * 文件夹类型(数字字典DIRCTORY_TYPE 1.通用技术方案 2.技术共享 3.解决方案 4.其他)
     */
    @Excel(name = "文件夹类型(数字字典DIRCTORY_TYPE 1.通用技术方案 2.技术共享 3.解决方案 4.其他)")
    @ApiModelProperty(value = "文件夹类型(数字字典DIRCTORY_TYPE 1.通用技术方案 2.技术共享 3.解决方案 4.其他)")
    private Long type;

    /**
     * 父级ID
     */
    @Excel(name = "父级ID")
    @ApiModelProperty(value = "父级ID")
    private Long parentId;

    /**
     * 组级列表
     */
    @Excel(name = "组级列表")
    @ApiModelProperty(value = "组级列表")
    private String ancestors;

    /**
     * 文档ID
     */
    @Excel(name = "文档ID")
    @ApiModelProperty(value = "文档ID")
    private Long documentId;

    /**
     * 删除标志
     */
    @ApiModelProperty(value = "文档ID")
    private Long delFlag;

    /**
     * 层级 1 2 3
     */
    @Excel(name = "层级 1 2 3")
    @ApiModelProperty(value = "层级 1 2 3")
    private Integer level;

    /**
     * 文档类型后缀
     */
    @TableField(exist = false)
    private String cType;

    /**
     * 子部门
     */
    @TableField(exist = false)
    private List<SpaceDirectory> children = new ArrayList<>();

    /**
     * 是否被收藏 0:未收藏 1：已收藏
     */
    @TableField(exist = false)
    private Integer isCollection;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("type", getType())
                .append("parentId", getParentId())
                .append("ancestors", getAncestors())
                .append("documentId", getDocumentId())
                .append("delFlag", getDelFlag())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("level", getLevel())
                .toString();
    }

}
